 <script type="text/javascript">
    bkLib.onDomLoaded(function()
    {
        new nicEditor(
        {
            iconsPath: '<?php echo Utility::getSiteUrl()?>/public/images/nicEditorIcons.gif'
        }
            ).panelInstance('contentOption');
    });
</script>
<div id="main">
    <?php if($optionID==-1) $mode='save_new'; else $mode='update'; ?>
    <b>Điều hướng:</b>
    <br />
    [ <a href="<?php echo Utility::getSiteUrl(); ?>/managequestions/index">Giáo viên: <?php echo $lectureID; ?></a> ]
    > [ <a href="<?php echo Utility::getSiteUrl(); ?>/managequestions/index/<?php echo $subjectID; ?>">Môn học: <?php echo $subjectID; ?></a> ]
    > [ <a href="<?php echo Utility::getSiteUrl(); ?>/managequestions/index/<?php echo $subjectID; ?>/<?php echo $sectionID; ?>">Phần học: <?php echo $sectionID; ?></a> ]
    > [ <b><a href="<?php echo Utility::getSiteUrl(); ?>/managequestions/index/<?php echo $subjectID; ?>/<?php echo $sectionID; ?>/<?php echo $questionID; ?>">Câu hỏi: <?php echo $questionID; ?></a></b> ]
    <br />
    <br />

    <?php if(isset($message)) echo "<center><font color=green><b>$message</b></font></center><br />"; ?>

    <form name="inputOption" id="inputOption" method='post' action="<?php echo Utility::getSiteUrl(); ?>/managequestions/<?php if($optionID ==-1)echo 'saveNewOption'; else echo 'updateOption' ;?>">

    <input type="hidden" name="lectureID" id="lectureID" value="<?php echo $lectureID; ?>">
    <input type="hidden" name="subjectID" id="subjectID" value="<?php echo $subjectID; ?>">
    <input type="hidden" name="sectionID" id="sectionID" value="<?php echo $sectionID; ?>">
    <input type="hidden" name="questionID" id="questionID" value="<?php echo $questionID; ?>">
    <?php if($mode=='update'){ ?>
    <input type="hidden" name="optionID" id="optionID" value="<?php echo $optionID; ?>">
    <?php ;} ?>
    <table  border="1" width="500">
        <tr>
            <td>Mã môn học: </td>
            <td><?php echo $subjectID; ?></td>
        </tr>
        <tr>
            <td>Mã phần học: </td>
            <td><?php echo $sectionID; ?></td>
        </tr>
        <tr>
            <td>Mã câu hỏi: </td>
            <td><?php echo $questionID; ?></td>
        </tr>
        <tr>
            <td>Mã đáp án: </td>
            <td><?php if($mode =='save_new')echo 'chưa có'; else echo $option->id; ?></td>
        </tr>

        <tr>
            <td>Nội dung: </td>
            <td><textarea  name="contentOption" id="contentOption" rows="12" cols="120"><?php if($mode=='update')echo $option->content; else echo''?></textarea></td>
        </tr>
        <tr>
            <td>Đúng và sai: </td>
            <td>
                <select name="trueOrFalse" id="trueOrFalse">
                    <option value="1" <?php if($mode == 'update'){if($option->trueorfalse)echo 'select="selected"'; else echo '';} ?> >true</option>
                    <option value="0" <?php if($mode == 'update'){if(!$option->trueorfalse)echo ''; else echo 'select="selected"';} ?> >false</option>
                </select>
            </td>
       </tr>
       <tr>
            <td>Tải ảnh: </td>
            <td>
                <input type="button" value="thêm ảnh" onclick="window.open('<?php echo Utility::getSiteUrl(); ?>/upload ','Upload','menubar=no,width=800,height=500,toolbar=no')" />
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <center>
                    <input type="submit" value="<?php if($mode == 'update') echo 'Cập nhật'; else echo 'Lưu mới'; ?>">
                </center>
            </td>
        </tr>
    </table>
    </form>
</div>
